package pageblock;

/**
 * Created by IntelliJ IDEA.
 * User: Evgeniy Krasko
 * Date: 30.10.11
 * Time: 17:20
 */
public enum PageBlockType {
    FIRST_PARAGRAPH(1),
    INFO_BOX(2),
    PICTURE(3);

    private int typeId;

    PageBlockType(int typeId) {
        this.typeId = typeId;
    }

    public int getTypeId() {
        return typeId;
    }

    public static PageBlockType getById(int id) {
        for (PageBlockType pageBlockType : values()) {
            if (pageBlockType.getTypeId() == id) {
                return pageBlockType;
            }
        }
        return null;
    }
}
